About the FileMaker Admin API PKI authentication scripts
========================================================

The included files provide an example of how to generate a
  JSON Web Token (JWT) and how to send a login request using
  the FileMaker Admin API and a generated JWT.


Included files
==============
1. fmadminapi_pki_token_example.py
      The code in this file generates a valid JWT for use
      with FileMaker Admin API PKI authentication. This code
      first generates a public and private key pair using
      the ssh-keygen command and converts the public key to
      the Privacy-Enhanced Mail (PEM) format using the OpenSSL command. The code uses
      the following command-line commands to generate a
      public and private key pair and then converts the
      public key to the PEM format:
          First: ssh-keygen -t rsa -b 4096 -m PEM -f <Key Path>.key
          Second: openssl rsa -in <Key Path>.key -pubout -outform PEM -out <Key Path>.key.pub
      When running the following command, the code will
      prompt you to enter a name for your public and private key pair,
	  create a passphrase for your public and private key files,
	  enter the passphrase for the public and private key files,
      set an expiration time for the token (the default is
      24 hours), set a name to use both for your token file
	  and for Admin Console to display as your public key,
	  and enter the passphrase for the public and private key files:
          Python 2: python path_to_fmadminapi_pki_token_example.py
          Python 3: python3 path_to_fmadminapi_pki_token_example.py
2. fmadminapi_pki_request_example.py
      This sample code provides an example of authenticating
      with FileMaker Admin API PKI authentication. When running
      the following command, the code will prompt you
      for a JWT and a host name. The code will send a login request to FileMaker
      Server using FileMaker Admin API PKI authentication:
          Python 2: python path_to_fmadminapi_pki_request_example.py
          Python 3: python3 path_to_fmadminapi_pki_request_example.py


Required Python libraries
=========================
If you use Python 3, install the required libraries using
  pip3. You can check your version of Python using the
  following commands:
      Python 2: python --version
      Python 3: python3 --version
If you use Ubuntu 22.04 LTS or Ubuntu 20.04 LTS, then the following required libraries
    should be installed already. However, you may also 
    manually install the packages using the
    Ubuntu 22.04 LTS or Ubuntu 20.04 LTS commands found in the next section.
The following files contain dependencies; use the commands
  following the library names to install the required
  libraries:
      1. fmadminapi_pki_token_example.py
            jwt:
                Reference: https://pypi.org/project/PyJWT/
                Python 2: pip install pyjwt
                Python 3: pip3 install pyjwt
                Ubuntu 22.04 LTS or Ubuntu 20.04 LTS: sudo apt install python3-jwt
            cryptography:
                Reference: https://pypi.org/project/cryptography/
                Python 2: pip install cryptography
                Python 3: pip3 install cryptography
                Ubuntu 22.04 LTS or Ubuntu 20.04 LTS: sudo apt install python3-cryptography
      2. fmadminapi_pki_request_example.py
            requests:
                Reference: https://pypi.org/project/requests/
                Python 2: pip install requests
                Python 3: pip3 install requests
                Ubuntu 22.04 LTS or Ubuntu 20.04 LTS: sudo apt install python3-requests
